

package com.yeyks.modules.sys.controller;

import com.yeyks.account.dal.domain.AccountInfo;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Controller公共组件
 *
 * @author administrator
 */
public abstract class AbstractController {
	protected Logger logger = LoggerFactory.getLogger(getClass());
	
	protected AccountInfo getUser() {
		return (AccountInfo) SecurityUtils.getSubject().getPrincipal();

		//return (AccountInfo)request.getAttribute("loginUser") ;

	}

	protected Long getUserId() {
		return Long.valueOf(getUser().getId());
	}

	protected Integer getDeptId() {
		return getUser().getDeptId();
	}
}
